﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using XNAProjectLibrary;
using XNAProject.GameElements;

namespace XNAProject
{
    public sealed class FleetManagerState : BaseGameState, IFleetManagerState
    {
        private SpriteFont font;

        private SaveFleet fleet;
        private FleetManagerPanel fleetManagerPanel;

        public FleetManagerState(Game game)
            : base(game)
        {
            game.Services.AddService(typeof(IFleetManagerState), this);

            fleet = new SaveFleet();
            fleet.Name = "";
            fleetManagerPanel = new FleetManagerPanel(Game, fleet);
            game.Components.Add(fleetManagerPanel);
        }                                                                                                   
        public override void Update(GameTime gameTime)
        {
            if (Input.WasPressed(0, Buttons.Start, Keys.Escape))                                             //input handling
            {
                Game.Services.RemoveService(typeof(IFleetManagerState));
                Game.Components.Remove(fleetManagerPanel);
                GameManager.ChangeState(OurGame.StartMenuState.Value);
            }

            base.Update(gameTime);
        }

        protected override void LoadContent()
        {

            base.LoadContent();
        }

        public override void Draw(GameTime gameTime)
        {                                                                    
            base.Draw(gameTime);
        }

        
    }
}
